package com.c6906.vdam.das.common;

import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;

import java.util.UUID;

public class IDGenUtil {
    private static final long WORKER_ID = 1;      // 自定义 Worker ID
    private static final long DATACENTER_ID = 1; // 自定义 Data Center ID

    private static final Snowflake snowflake = IdUtil.getSnowflake(WORKER_ID, DATACENTER_ID);

    public static long generateId() {
        return snowflake.nextId();
    }

    public static String getUUIDWithoutDash() {
        return UUID.randomUUID().toString().replaceAll("-", "");
    }
}
